

********************************************************************************
* Figure 5: 7-day Window around FOMC Meetings
********************************************************************************

*********************************
* (A) 10y Treasury yield
*********************************

use "../data/final_data_fed_secular_decline", clear

keep if date >= mdy(6,1,1989)
drop if date >= mdy(7,1,2021)

local x "sveny10_chg"

sort date
generate FOMC_change  = `x'  	if  !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1])
generate FOMC_7dchange  = `x'  	if  !missing(fomc_meet[_n+3]) | !missing(fomc_meet[_n+2]) | !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1]) | !missing(fomc_meet[_n-2]) | !missing(fomc_meet[_n-3])

gen cum_`x'			= sum(`x')
gen cum_FOMC_change = sum(FOMC_change)
gen cum_FOMC_7dchange = sum(FOMC_7dchange)
	
twoway line cum_`x'  cum_FOMC_7dchange cum_FOMC_change  date, ///
scheme(s1mono) lcolor(gs6 blue red) ///
lstyle(solid solid dash) ///
xlabel(, format(%tdCCYY)) ///
ylabel(, angle(horizontal)) ///
ytitle("Cumulative yield change (%)") ///
xtitle("") ///
legend(cols(1) symxsize(*0.5) ///
label(1 "10y Treasury yield") ///
label(3 "10y Treasury yield change in 3-day FOMC window") ///
label(2 "10y Treasury yield change in 7-day FOMC window"))	
graph export "../figures/figure5a.png", replace


*********************************
* (B) 5y5y Treasury yield
*********************************

use "../data/final_data_fed_secular_decline", clear

keep if date >= mdy(6,1,1989)
drop if date >= mdy(7,1,2021)

local x "fwd5y5y_chg"

sort date
generate FOMC_change  = `x'  	if  !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1])
generate FOMC_7dchange  = `x'  	if  !missing(fomc_meet[_n+3]) | !missing(fomc_meet[_n+2]) | !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1]) | !missing(fomc_meet[_n-2]) | !missing(fomc_meet[_n-3])

gen cum_`x'			= sum(`x')
gen cum_FOMC_change = sum(FOMC_change)
gen cum_FOMC_7dchange = sum(FOMC_7dchange)
	
twoway line cum_`x'  cum_FOMC_7dchange cum_FOMC_change  date, ///
scheme(s1mono) lcolor(gs6 blue red) ///
lstyle(solid solid dash) ///
xlabel(, format(%tdCCYY)) ///
ylabel(, angle(horizontal)) ///
ytitle("Cumulative yield change (%)") ///
xtitle("") ///
legend(cols(1) symxsize(*0.5) ///
label(1 "5y5y Treasury yield") ///
label(3 "5y5y Treasury yield change in 3-day FOMC window") ///
label(2 "5y5y Treasury yield change in 7-day FOMC window"))	
graph export "../figures/figure5b.png", replace